﻿using DAL;
using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace Webmember.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class BangController : ControllerBase
    {
        public BangController(IBangBLL bangBLL)
        {
            BangBLL = bangBLL;
        }

        public IBangBLL BangBLL { get; }

        /// <summary>
        /// 绑定下拉框添加
        /// </summary>
        /// <param name="memberType">表名</param>
        /// <returns>返回受影响行数</returns>
        [HttpPost]
        public Task<int> BangTian(memberType memberType)
        {
            return BangBLL.BangTian(memberType);
        }
        /// <summary>
        /// 绑定下拉框列表显示
        /// </summary>
        /// <returns>返回受影响函数</returns>
        [HttpGet]
        public IQueryable<memberType> BangXian()
        {
            return BangBLL.BangXian();
        }
    }
}
